1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 
29 module derelict.glib.gconvert;
30 
31 import derelict.glib.gtypes;
32 import derelict.glib.glibconfig;
33 import derelict.glib.gquark;
34 import derelict.glib.gerror;
35 import core.stdc.config;
36 
37 extern (C):
38 
39 alias _Anonymous_0 GConvertError;
40 alias _GIConv* GIConv;
41 
42 enum _Anonymous_0
43 {
44 	G_CONVERT_ERROR_NO_CONVERSION = 0,
45 	G_CONVERT_ERROR_ILLEGAL_SEQUENCE = 1,
46 	G_CONVERT_ERROR_FAILED = 2,
47 	G_CONVERT_ERROR_PARTIAL_INPUT = 3,
48 	G_CONVERT_ERROR_BAD_URI = 4,
49 	G_CONVERT_ERROR_NOT_ABSOLUTE_PATH = 5
50 }
51 
52 struct _GIConv;
53 
54 version(Derelict_Link_Static)
55 {
56     extern( C ) nothrow 
57     {
58         GQuark g_convert_error_quark();
59         GIConv g_iconv_open(const(gchar)* to_codeset, const(gchar)* from_codeset);
60         gsize g_iconv(GIConv converter, gchar** inbuf, gsize* inbytes_left, gchar** outbuf, gsize* outbytes_left);
61         gint g_iconv_close(GIConv converter);
62         gchar* g_convert(const(gchar)* str, gssize len, const(gchar)* to_codeset, const(gchar)* from_codeset, gsize* bytes_read, gsize* bytes_written, GError** error);
63         gchar* g_convert_with_iconv(const(gchar)* str, gssize len, GIConv converter, gsize* bytes_read, gsize* bytes_written, GError** error);
64         gchar* g_convert_with_fallback(const(gchar)* str, gssize len, const(gchar)* to_codeset, const(gchar)* from_codeset, const(gchar)* fallback, gsize* bytes_read, gsize* bytes_written, GError** error);
65         gchar* g_locale_to_utf8(const(gchar)* opsysstring, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);
66         gchar* g_locale_from_utf8(const(gchar)* utf8string, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);
67         gchar* g_filename_to_utf8(const(gchar)* opsysstring, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);
68         gchar* g_filename_from_utf8(const(gchar)* utf8string, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);
69         gchar* g_filename_from_uri(const(gchar)* uri, gchar** hostname, GError** error);
70         gchar* g_filename_to_uri(const(gchar)* filename, const(gchar)* hostname, GError** error);
71         gchar* g_filename_display_name(const(gchar)* filename);
72         gboolean g_get_filename_charsets(const(gchar**)* charsets);
73         gchar* g_filename_display_basename(const(gchar)* filename);
74         gchar** g_uri_list_extract_uris(const(gchar)* uri_list);
75     }
76 }
77 else
78 {
79     extern( C ) nothrow 
80     {
81         alias da_g_convert_error_quark = GQuark function();																																												
82         alias da_g_iconv_open = GIConv function(const(gchar)* to_codeset, const(gchar)* from_codeset);																																	
83         alias da_g_iconv = gsize function(GIConv converter, gchar** inbuf, gsize* inbytes_left, gchar** outbuf, gsize* outbytes_left);																									
84         alias da_g_iconv_close = gint function(GIConv converter);																																										
85         alias da_g_convert = gchar* function(const(gchar)* str, gssize len, const(gchar)* to_codeset, const(gchar)* from_codeset, gsize* bytes_read, gsize* bytes_written, GError** error);												
86         alias da_g_convert_with_iconv = gchar* function(const(gchar)* str, gssize len, GIConv converter, gsize* bytes_read, gsize* bytes_written, GError** error);																		
87         alias da_g_convert_with_fallback = gchar* function(const(gchar)* str, gssize len, const(gchar)* to_codeset, const(gchar)* from_codeset, const(gchar)* fallback, gsize* bytes_read, gsize* bytes_written, GError** error);		
88         alias da_g_locale_to_utf8 = gchar* function(const(gchar)* opsysstring, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);																					
89         alias da_g_locale_from_utf8 = gchar* function(const(gchar)* utf8string, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);																					
90         alias da_g_filename_to_utf8 = gchar* function(const(gchar)* opsysstring, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);																					
91         alias da_g_filename_from_utf8 = gchar* function(const(gchar)* utf8string, gssize len, gsize* bytes_read, gsize* bytes_written, GError** error);																					
92         alias da_g_filename_from_uri = gchar* function(const(gchar)* uri, gchar** hostname, GError** error);																															
93         alias da_g_filename_to_uri = gchar* function(const(gchar)* filename, const(gchar)* hostname, GError** error);																													
94         alias da_g_filename_display_name = gchar* function(const(gchar)* filename);																																						
95         alias da_g_get_filename_charsets = gboolean function(const(gchar**)* charsets);																																					
96         alias da_g_filename_display_basename = gchar* function(const(gchar)* filename);																																					
97         alias da_g_uri_list_extract_uris = gchar** function(const(gchar)* uri_list);																																					
98     }
99 
100     __gshared
101     {
102         da_g_convert_error_quark g_convert_error_quark; 
103         da_g_iconv_open g_iconv_open; 
104         da_g_iconv g_iconv; 
105         da_g_iconv_close g_iconv_close; 
106         da_g_convert g_convert; 
107         da_g_convert_with_iconv g_convert_with_iconv; 
108         da_g_convert_with_fallback g_convert_with_fallback; 
109         da_g_locale_to_utf8 g_locale_to_utf8; 
110         da_g_locale_from_utf8 g_locale_from_utf8; 
111         da_g_filename_to_utf8 g_filename_to_utf8; 
112         da_g_filename_from_utf8 g_filename_from_utf8; 
113         da_g_filename_from_uri g_filename_from_uri; 
114         da_g_filename_to_uri g_filename_to_uri; 
115         da_g_filename_display_name g_filename_display_name; 
116         da_g_get_filename_charsets g_get_filename_charsets; 
117         da_g_filename_display_basename g_filename_display_basename; 
118         da_g_uri_list_extract_uris g_uri_list_extract_uris; 
119     }
120 }